﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="application-list.aspx.cs"
    Inherits="SmartSpace.WebApp._console.core.application_list" MasterPageFile="~/_console/_console.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderHead" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderMenu" runat="server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="ContentPlaceHolderTitle" runat="server">
    application list
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolderToolbar" runat="server">
    <a href="application-add.aspx">添加</a>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolderContent" runat="server">
    <div class="form">
        <asp:Repeater ID="_ctlList" runat="server" DataMember="Id" OnItemCommand="_ctlList_ItemCommand">
            <HeaderTemplate>
                <table>
                    <tr>
                        <th style="width: 50px;">-
                        </th>
                        <th>名称
                        </th>
                        <th>默认应用
                        </th>
                        <th>排序号
                        </th>
                        <th>主题
                        </th>
                        <th>modules
                        </th>
                        <th>类型
                        </th>
                        <th>导航
                        </th>
                        <th>操作
                        </th>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <span id="_ctlLabel" runat="server" visible='<%# IsSelected(Eval("Id")) %>'>已选择</span>
                        <a id="_ctlLink" href='<%# Eval("Id","?id={0}") %>' runat="server" visible='<%# !IsSelected(Eval("Id")) %>'>选择</a>
                    </td>
                    <td>
                        <img src="./image-preview.aspx?id=<%# Eval("ImageId") %>" width="16" height="16" />
                        <%# Eval("Name") %>
                    </td>
                    <td>
                        <asp:LinkButton ID="_ctlBtnEnable" Text="设置默认" runat="server" CommandName="enable"
                            CommandArgument='<%# Eval("Id") %>' Visible='<%# !((bool)Eval("IsDefault")) %>' OnClientClick='<%# Eval("Name","return confirm(\"do you want setting application [{0}] to default\");")%>' />
                        <asp:LinkButton ID="_ctlBtnDisable" Text="取消默认" runat="server" CommandName="disable"
                            CommandArgument='<%# Eval("Id") %>' Visible='<%# Eval("IsDefault") %>' OnClientClick='<%# Eval("Name","return confirm(\"do you want undo the default property of application [{0}]\");")%>' />
                    </td>
                    <td>
                        <%# Eval("SortIndex") %>
                    </td>
                    <td>
                        <a href='<%# Eval("Id","./application-theme-assign.aspx?id={0}") %>' title="click to select other theme">
                            <%# GetThemeName(Eval("ThemeId"))%>
                        </a>
                    </td>
                    <td>
                        <a href='<%# Eval("Id","./application-module-assign.aspx?id={0}") %>' title="click to setting modules">
                            settings
                        </a>
                    </td>
                    <td>
                        <%# Eval("Type") %>
                    </td>
                    <td>
                        <a href='./application-navigation-list.aspx?id=<%# Eval("Id") %>'>设置</a>
                        <a href='./application-navigation-assign.aspx?id=<%# Eval("Id") %>'>分配</a>
                    </td>
                    <td>
                        <a href='./application-edit.aspx?id=<%# Eval("Id") %>'>修改</a>
                        <asp:LinkButton ID="_ctlCmdDelete" runat="server" OnClick="_ctlCmdDelete_Click" CommandArgument='<%# Eval("Id") %>' OnClientClick='<%# Eval("Name","return confirm(\"do you want delete application [{0}]\");")%>'>delete</asp:LinkButton>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
    </div>
</asp:Content>
